import request from '@/utils/request'

//商品服务的基础地址前缀
const BASE_URL = '/product-api'
/**
 * 文件上传接口
 * @param {File} file - 要上传的文件对象
 * @returns
 */
export function fileUpload(file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: `${BASE_URL}/file/upload`,
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
